namespace A{
  interface Animal{
    name:string;
    eat():void;
  }
  export class Dog implements Animal{
    name:string;
    constructor(name:string){
      this.name = name;
    }
    eat(){
      console.log(this.name+"吃吃吃");
    }
  }
}
namespace B{
  interface Animal{
    name:string;
    eat():void;
  }
  export class Dog implements Animal{
    name:string;
    constructor(name:string){
      this.name = name;
    }
    eat(){
      console.log(this.name+"喝喝喝");
    }
  }
}

let dog = new A.Dog("黑子");
dog.eat();
let cat = new B.Dog("咪咪");
cat.eat();